home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v9n17.arc / WHATNDP.SCR < prev   
Text File  |  1990-09-12  |  2KB  |  58 lines

  1. N WHATNDP.COM
  2. A
  3. JMP       0136
  4. DB        0D,0A,"No NDP installed",0D,0A,"$"
  5. DB        0D,0A,"NDP is an 80$"
  6. DB        "87$"
  7. DB        "287$"
  8. DB        "387$"
  9. DB        0D,0A,"$"
  10. DB        0,0
  11. FINIT                              ;Check for coprocessor
  12. FSTCW     [0134]                   ;  by initializing it
  13. CMP       BYTE PTR [0135],3        ;  and looking at the
  14. JZ        014B                     ;  bits 8 and 9 of the
  15. MOV       AH,9                     ;  control word
  16. MOV       DX,0102                  ;Exit if there's nothing
  17. INT       21                       ;  there
  18. RET
  19. MOV       AH,9                     ;Print opening message
  20. MOV       DX,0117
  21. INT       21
  22. MOV       DX,0126                  ;Test for 8087 by seeing
  23. AND       WORD PTR [0134],FF7F     ;  if the FDISI instruction
  24. WAIT                               ;  sets the IEM bit in the
  25. FLDCW     [0134]                   ;  coprocessor control word
  26. WAIT
  27. FDISI
  28. WAIT
  29. FSTCW     [0134]
  30. TEST      WORD PTR [0134],80
  31. JNZ       018F                     ;Branch if NDP is an 8087
  32. MOV       DX,0129                  ;Distinguish between 287
  33. FINIT                              ;  and 387 by determining
  34. FLD1                               ;  whether the NDP is
  35. FLDZ                               ;  initialized to affine
  36. FDIVP     ST(1),ST                 ;  (387) or projective
  37. FLD       ST(0)                    ;  (287) infinity
  38. FCHS
  39. FCOMPP
  40. FSTSW     [0134]
  41. WAIT
  42. MOV       AX,[0134]
  43. SAHF
  44. JZ        018F                     ;Branch if 287
  45. MOV       DX,012D                  ;It's a 387!
  46. MOV       AH,9                     ;Print NDP type and exit
  47. INT       21
  48. MOV       AH,9
  49. MOV       DX,0131
  50. INT       21
  51. RET
  52.  
  53. RCX
  54. 9B
  55. W
  56. Q
  57.  
  58.